<!-- if语句 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>   
var time = new Date().getHours();//获取当前时间
    if(time>18) {
        console.log("Good evening!");
    } else if(time>12) {
        console.log("Good afternoon!");
    } else {
        console.log("Good morning!");
        }
</script>
<body>
    
</body>
</html>